"""author: xueyou
   data: 2020/11/9
   project: PycharmProjects
"""
import re

#1、

# while True:
#     msg = input('请输入数字:')
#     if msg == "exit":
#         break
#     elif re.findall(r'^[+]?[1-9]\d*$',msg):
#         print("数字为正整数")
#     elif re.findall(r'^-[1-9]\d*$',msg):
#         print("数字为负整数")
#     elif re.findall(r'^[-+]?[1-9]\d*\.\d*$|[0-9]\.\d*$',msg):
#         print("数字为浮点数")
#     else:
#         print("请输入数字")

#2、
# while True:
#     password = input("请输入密码:")
#     if password == "exit":
#         break
#     if re.findall("^[a-z]|^[A-Z]|^_",password):
#         if len(password) >= 8 and len(password) <=10:
#             print("密码合格")
#         else:
#             print("密码不合格，请输入8-10位数密码")
#     else:
#         print("密码不合格，请以字母或者下划线开头")

#3、

# phone_num = input("请输入电话号码:")
# result = re.findall(r'(?:\(\+\d{2}\)[ ]?)?\d{3}[\s-]?\d{4}[\s-]?\d{4}',phone_num)
# print(result)



